﻿/******************************************************************************
 *  All Rights Reserved , Copyright (C) 2012 , EricHu. 
 *  作    者： EricHu
 *  创建时间： 2012-7-20 16:35:49
 ******************************************************************************/

using System;
using System.Data;

namespace RDIFramework.BusinessEntity
{
      using RDIFramework.Utilities;

     /// <summary>
     /// CiParameterEntity
     /// 系统参数配置表
     ///
     /// 修改纪录
     ///
     ///		2012-03-02 版本：1.0 EricHu 创建主键。
     ///
     /// 版本：1.0
     ///
     /// <author>
     ///		<name>EricHu</name>
     ///		<date>2012-03-02</date>
     /// </author>
     /// </summary>
    [Serializable]
    public partial class CiParameterEntity
    {
        private int? id = null;
        /// <summary>
        /// 主键
        /// </summary>
        public int? Id
        {
            get
            {
                return this.id;
            }
            set
            {
                this.id = value;
            }
        }

        private String categoryId = string.Empty;
        /// <summary>
        /// 分类主键
        /// </summary>
        public String CategoryId
        {
            get
            {
                return this.categoryId;
            }
            set
            {
                this.categoryId = value;
            }
        }

        private String parameterId = string.Empty;
        /// <summary>
        /// 参数主键
        /// </summary>
        public String ParameterId
        {
            get
            {
                return this.parameterId;
            }
            set
            {
                this.parameterId = value;
            }
        }

        private String parameterCode = string.Empty;
        /// <summary>
        /// 参数编号
        /// </summary>
        public String ParameterCode
        {
            get
            {
                return this.parameterCode;
            }
            set
            {
                this.parameterCode = value;
            }
        }

        private String parameterContent = string.Empty;
        /// <summary>
        /// 参数具体内容
        /// </summary>
        public String ParameterContent
        {
            get
            {
                return this.parameterContent;
            }
            set
            {
                this.parameterContent = value;
            }
        }

        private int? worked = 0;
        /// <summary>
        /// 处理审核过
        /// </summary>
        public int? Worked
        {
            get
            {
                return this.worked;
            }
            set
            {
                this.worked = value;
            }
        }

        private int? enabled = 1;
        /// <summary>
        /// 有效
        /// </summary>
        public int? Enabled
        {
            get
            {
                return this.enabled;
            }
            set
            {
                this.enabled = value;
            }
        }

        private String description = string.Empty;
        /// <summary>
        /// 描述
        /// </summary>
        public String Description
        {
            get
            {
                return this.description;
            }
            set
            {
                this.description = value;
            }
        }

        private int? sortCode = null;
        /// <summary>
        /// 排序码
        /// </summary>
        public int? SortCode
        {
            get
            {
                return this.sortCode;
            }
            set
            {
                this.sortCode = value;
            }
        }

        private int? deleteMark = 0;
        /// <summary>
        /// 删除标志
        /// </summary>
        public int? DeleteMark
        {
            get
            {
                return this.deleteMark;
            }
            set
            {
                this.deleteMark = value;
            }
        }

        private DateTime? createOn = DateTime.Now;
        /// <summary>
        /// 创建日期
        /// </summary>
        public DateTime? CreateOn
        {
            get
            {
                return this.createOn;
            }
            set
            {
                this.createOn = value;
            }
        }

        private String createUserId = string.Empty;
        /// <summary>
        /// 创建用户主键
        /// </summary>
        public String CreateUserId
        {
            get
            {
                return this.createUserId;
            }
            set
            {
                this.createUserId = value;
            }
        }

        private String createBy = string.Empty;
        /// <summary>
        /// 创建用户
        /// </summary>
        public String CreateBy
        {
            get
            {
                return this.createBy;
            }
            set
            {
                this.createBy = value;
            }
        }

        private DateTime? modifiedOn = null;
        /// <summary>
        /// 修改日期
        /// </summary>
        public DateTime? ModifiedOn
        {
            get
            {
                return this.modifiedOn;
            }
            set
            {
                this.modifiedOn = value;
            }
        }

        private String modifyUserId = string.Empty;
        /// <summary>
        /// 修改用户主键
        /// </summary>
        public String ModifyUserId
        {
            get
            {
                return this.modifyUserId;
            }
            set
            {
                this.modifyUserId = value;
            }
        }

        private String modifiedBy = string.Empty;
        /// <summary>
        /// 修改用户
        /// </summary>
        public String ModifiedBy
        {
            get
            {
                return this.modifiedBy;
            }
            set
            {
                this.modifiedBy = value;
            }
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        public CiParameterEntity()
        {
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public CiParameterEntity(DataRow dataRow)
        {
            this.GetFrom(dataRow);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public CiParameterEntity(IDataReader dataReader)
        {
            this.GetFrom(dataReader);
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public CiParameterEntity(DataTable dataTable)
        {
            this.GetFrom(dataTable);
        }

        /// <summary>
        /// 从数据表读取
        /// </summary>
        /// <param name="dataTable">数据表</param>
        public CiParameterEntity GetFrom(DataTable dataTable)
        {
            if ((dataTable == null) || (dataTable.Rows.Count == 0))
            {
                return null;
            }
            foreach (DataRow dataRow in dataTable.Rows)
            {
                this.GetFrom(dataRow);
                break;
            }
            return this;
        }

        /// <summary>
        /// 从数据行读取
        /// </summary>
        /// <param name="dataRow">数据行</param>
        public CiParameterEntity GetFrom(DataRow dataRow)
        {
            this.Id = BusinessLogic.ConvertToInt(dataRow[CiParameterTable.FieldId]);
            this.CategoryId = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldCategoryId]);
            this.ParameterId = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldParameterId]);
            this.ParameterCode = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldParameterCode]);
            this.ParameterContent = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldParameterContent]);
            this.Worked = BusinessLogic.ConvertToInt(dataRow[CiParameterTable.FieldWorked]);
            this.Enabled = BusinessLogic.ConvertToInt(dataRow[CiParameterTable.FieldEnabled]);
            this.Description = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldDescription]);
            this.DeleteMark = BusinessLogic.ConvertToInt(dataRow[CiParameterTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt(dataRow[CiParameterTable.FieldSortCode]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataRow[CiParameterTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldCreateBy]);
            this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataRow[CiParameterTable.FieldModifiedOn]);
            this.ModifyUserId = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldModifyUserId]);
            this.ModifiedBy = BusinessLogic.ConvertToString(dataRow[CiParameterTable.FieldModifiedBy]);
            return this;
        }

        /// <summary>
        /// 从数据流读取
        /// </summary>
        /// <param name="dataReader">数据流</param>
        public CiParameterEntity GetFrom(IDataReader dataReader)
        {
            this.Id = BusinessLogic.ConvertToInt(dataReader[CiParameterTable.FieldId]);
            this.CategoryId = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldCategoryId]);
            this.ParameterId = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldParameterId]);
            this.ParameterCode = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldParameterCode]);
            this.ParameterContent = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldParameterContent]);
            this.Worked = BusinessLogic.ConvertToInt(dataReader[CiParameterTable.FieldWorked]);
            this.Enabled = BusinessLogic.ConvertToInt(dataReader[CiParameterTable.FieldEnabled]);
            this.Description = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldDescription]);
            this.DeleteMark = BusinessLogic.ConvertToInt(dataReader[CiParameterTable.FieldDeleteMark]);
            this.SortCode = BusinessLogic.ConvertToInt(dataReader[CiParameterTable.FieldSortCode]);
            this.CreateOn = BusinessLogic.ConvertToDateTime(dataReader[CiParameterTable.FieldCreateOn]);
            this.CreateUserId = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldCreateUserId]);
            this.CreateBy = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldCreateBy]);
            this.ModifiedOn = BusinessLogic.ConvertToDateTime(dataReader[CiParameterTable.FieldModifiedOn]);
            this.ModifyUserId = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldModifyUserId]);
            this.ModifiedBy = BusinessLogic.ConvertToString(dataReader[CiParameterTable.FieldModifiedBy]);
            return this;
        }
    }
}
